home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / TinyGL / ami / content / ad709 / tinygl / src / clear.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-08-15  |  966 b   |  36 lines

  1. /*$T clear.c GC 1.137 08/09/02 17:47:18 */
  2.  
  3. /*$6
  4.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  5.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  6.  */
  7.  
  8. #include "zgl.h"
  9.  
  10. /* */
  11.  
  12. void glopClearColor(GLContext *c, GLParam *p) {
  13.     c->clear_color.v[0] = p[1].f;
  14.     c->clear_color.v[1] = p[2].f;
  15.     c->clear_color.v[2] = p[3].f;
  16.     c->clear_color.v[3] = p[4].f;
  17. }
  18.  
  19. /* */
  20. void glopClearDepth(GLContext *c, GLParam *p) {
  21.     c->clear_depth = p[1].f;
  22. }
  23.  
  24. /* */
  25. void glopClear(GLContext *c, GLParam *p) {
  26.     int mask = p[1].i;
  27.     int z = 0;
  28.     int r = (int) (c->clear_color.v[0] * 65535);
  29.     int g = (int) (c->clear_color.v[1] * 65535);
  30.     int b = (int) (c->clear_color.v[2] * 65535);
  31.     /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  32.  
  33.     /* TODO : correct value of Z */
  34.     ZB_clear(c->zb, mask & GL_DEPTH_BUFFER_BIT, z, mask & GL_COLOR_BUFFER_BIT, r, g, b);
  35. }
  36.